refactor: schedule management and tab store #1105
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors two sections of our app: Schedule Management (the tab UI) and
TabStore
(the global tab store).Schedule Management
Schedule Management Tabs have been refactored to be largely simpler and require only one component for both desktop and mobile. Tab Content (i.e. Tab Panels) have been refactored into a separate component. No logic has changed here.
Tab Store
Tab Store has also been refactored to largely be simpler. Previously, we would not render the Calendar tab on mobile, as it would be shown on the left hand side. However, this would result in inconsistent and double-logic to handle tab switching across both mobile and desktop.
Now, all tabs are rendered so the index of each (calendar = 0, search = 1, ...) are always consistent. The setter for
TabStore
now has two variants:setActiveTabValue
for setting the value ofactiveTab
via value (number
) andsetActiveTab
for setting the value via a string literal union.setActiveTab
will be used in all cases where we programmatically change the tab (e.g.focusMap
), andsetActiveTabValue
will be used for event handlers.Examples:
Test Plan
/added
,/map
, etc. The correct panel should be selectedquickSearchForClasses
. Search panel should open.Issues
Closes #